home *** CD-ROM | disk | FTP | other *** search
/ EuroCD 3 / EuroCD 3.iso / Programming / SecalDemo / QuickRefs.txt < prev    next >
Text File  |  1998-06-24  |  9KB  |  272 lines

  1.            Quick summary of the Secal instruction set and syntax
  2.            =====================================================
  3.  
  4. The Secal compiler recognises the followings:
  5.  
  6. - Secal instructions
  7. - Assembly
  8.     (Standard Motorola 68000-68020 assembly instructions, closed by a
  9.     semicolon, with the Secal syntax of effective addressing (see later).
  10.     Also the operand separator have been changed to a comma (",") in some
  11.     special cases, where standard assembly uses something else)
  12. - Labels
  13.     (An identifier followed by a colon, for marking a program location)
  14. - Assignments
  15.     (In the form of "ea := expression ;")
  16.  
  17. >-------------------------------------------------------------------------<
  18.  
  19.                             Secal instructions
  20.                             ~~~~~~~~~~~~~~~~~~
  21. Legend:
  22.   <xx>       = to be substituted
  23.   [xx]       = optional
  24.   xx1, xx2   = repeatable
  25.   <...>      = multiple instructions
  26.   ...        = multiple macro parameters
  27.   xx | xx    = one or the other
  28.   ea         = effective address
  29.  
  30. Conditional execution:
  31.   IF <cond> THEN <...> [ELIF <cond> THEN <...>] [ELSE <...>] ;
  32.  
  33. Loops:
  34.   REPEAT <...> UNTIL <cond> ;
  35.   WHILE <cond> DO <...> ;
  36.   FOR <counter> := <start> UPTO | DOWNTO | TO <stop> [STEP <step>] DO <...> ;
  37.  
  38. Macros:
  39.   DEF <id> [(<par1>, <par2>, ...)] [= <text>] ;
  40.   PATTERN <id> [(<par1>, <par2>, ...)] IS <...> ENDP ;
  41.  
  42. File inclusion:
  43.   INCLUDE "<filename>" ;
  44.   INCBIN "<filename>" [, <offset>, <size>] ;
  45.   INCOBJ "<filename>" ;
  46.   INCLIB "<filename>" ;
  47.  
  48. Section control:
  49.   SECTION <name> [, <type>] ;
  50.   SECTION <name> [, <type_a>, <org> [, <load>]] ;
  51.   CODE ; CODE_C ; CODE_F ; DATA ; DATA_C ; DATA_F ; BSS ; BSS_C ; BSS_F ;
  52.   ORG [<address>] ;
  53.  
  54. Direct code operations:
  55.   DC [. <size>] <val1>, <val2> ;
  56.   DS [. <size>] <count> ;
  57.   DCB [. <size>] <repcount> [, <val1>, <val2>] ;
  58.   BLK [. <size>] <count> [, <val1>, <val2>] ;
  59.   ALIGN <value> [, <offset>] ;
  60.  
  61. Compiler variable:
  62.   SET <id> = <value> ;
  63.  
  64. Variables, structures:
  65.   OBJ | DOBJ [<id1>, <id2>] : <type> = <initval> ;
  66.   STRUCT | UNION <id> IS <...> ;
  67.  
  68. Control transfer:
  69.   GO | CALL | GO_cc <address> ;
  70.  
  71. Stack operations:
  72.   PUSH [. <size>] <ea1 | reglist1>, <ea2 | reglist2> ;
  73.   POP <ea1 | reglist1>, <ea2 | reglist2> ;
  74.  
  75. Parallel assignments:
  76.   SAFE <...> ;
  77.  
  78. External interface:
  79.   IMPORT [<extname> AS] <id1>, <id2> : <type> ;
  80.   EXPORT <id1>, <id2> [AS <extname>] ;
  81.  
  82. Compiler options:
  83.   OPT <keyword> = <text> ;
  84.  
  85.  
  86.                            Effective addressing
  87.                            ~~~~~~~~~~~~~~~~~~~~
  88. M68000
  89.         Dn
  90.         An
  91.         [An]
  92.         [An+]
  93.         [-An]
  94.         [An+d16]
  95.         [An+Rn.SIZE+d8]
  96.         [PC+d16]
  97.         [PC+Rn.SIZE+d8]
  98.         [addr.w]
  99.         [addr.l]
  100.         const
  101.  
  102.         pc, sr, ccr, ssp, usp
  103.  
  104. M68020+
  105.         [An+Rn.SIZE*SCALE+d8]
  106.         [bd+An+Rn.SIZE*SCALE]
  107.         [[bd+An]+Rn.SIZE*SCALE+od]
  108.         [[bd+An+Rn.SIZE*SCALE]+od]
  109.         [PC+Rn.SIZE*SCALE+d8]
  110.         [bd+PC+Rn.SIZE*SCALE]
  111.         [[bd+PC]+Rn.SIZE*SCALE+od]
  112.         [[bd+PC+Rn.SIZE*SCALE]+od]
  113.  
  114.         Dx:Dy
  115.         sfc, dfc, vbr, cacr, caar, msp, isp
  116.  
  117.    (ZAn and ZPC can be used to indicate a suppressed base register.)
  118.  
  119.  
  120.                                    Types
  121.                                    ~~~~~
  122.         byte    .b
  123.         ubyte   .ub
  124.         word    .w
  125.         uword   .uw
  126.         long    .l
  127.         ulong   .ul
  128.  
  129.   In the place of these standard types, a new structure/union definition can
  130.   also be recognised, introduced with the STRUCT or UNION keyword, similar to
  131.   the STRUCT and UNION instructions.
  132.  
  133.  
  134.                                  Operators
  135.                                  ~~~~~~~~~
  136.         +, -, /, *
  137.         and = &, or = |, xor
  138.         lsl = <<, lsr = >>, asl, asr, rol, ror, roxl, roxr
  139.         bchg, bclr, bset
  140.         inv = ~, -
  141.  
  142.         orif = ||, andif = &&
  143.         not = !
  144.  
  145. >-------------------------------------------------------------------------<
  146.  
  147.                                  Secal.lib
  148.                                  ~~~~~~~~~
  149. String functions:
  150. ~~~~~~~~~~~~~~~~~
  151. StrLen( str )                                   -> d0.l=length, a0=stringend
  152. StrCopy( source, dest )                         -> a0=destend
  153. StrCopyM( source, dest, max )                   -> a0=destend
  154. StrDiff( source, dest )                         -> d0=firstdiff/0
  155. StrDiffI( source, dest )                        -> d0=firstdiff/0
  156. StrCat( source, dest )                          -> a0=destend
  157. StrCatM( source, dest, max )                    -> a0=destend
  158.  
  159. >-------------------------------------------------------------------------<
  160.  
  161.                                  Extension
  162.                                  ~~~~~~~~~
  163.  
  164. General functions:
  165. ~~~~~~~~~~~~~~~~~~
  166.   x_Init                                                -> d0=success
  167.   x_Done
  168.  
  169. Audio functions:
  170. ~~~~~~~~~~~~~~~~
  171.   x_AudioStart( chanmask )                              -> d0=success
  172.  
  173.   x_Mus_New( modul, chanmask )                          -> a0=mus/0
  174.   x_Mus_Load( filename, chanmask )                      -> a0=mus/0
  175.   x_Mus_Dispose( mus )
  176.   x_Mus_Play( mus, pos )
  177.   x_Mus_Stop( mus)
  178.   x_Mus_Continue( mus )
  179.   x_Mus_Modify( mus, pos, volume )
  180.  
  181.   x_PlaySound( start, length, repstart, replen, channel, period, volume )
  182.   x_StopSound( channel )
  183.   x_ModifySound( channel, period, volume )
  184.   x_PlaySoundQ( pri, start, length, repstart, replen, channel, period, volume )
  185.  
  186.   x_SetFilter( state )
  187.  
  188. Graphics variables:
  189. ~~~~~~~~~~~~~~~~~~~
  190.   x_VBlankCode : ulong
  191.   x_VBlankCnt : ulong
  192.  
  193. Graphics functions:
  194. ~~~~~~~~~~~~~~~~~~~
  195.   x_GraphicsStart
  196.  
  197.   x_Scr_Open( mode, width, height, depth, title, colors, taglist )   -> a0=scr/0
  198.   x_Scr_Close( scr )
  199.   x_Scr_AddBmp( scr )                                   -> d0=success
  200.   x_Scr_ActivateBmp( scr, index, xoffset, yoffset )
  201.   x_Scr_GetBmp( scr, index )                            -> a0=bmp
  202.   x_Scr_LoadRGB8( scr, colors, start, count )
  203.  
  204.   x_RGB8Intensity( source, count, dest, intensity, target )
  205.  
  206.   x_Bmp_Alloc( width, height, depth )                   -> a0=bmp/0
  207.   x_Bmp_Free( bmp )
  208.  
  209.   x_Ani_New( animdata, looping )                        -> a0=ani/0, a1=rbg8, d0=numcolors
  210.   x_Ani_Load( filename, looping )                       -> a0=ani/0, a1=rbg8, d0=numcolors
  211.   x_Ani_Dispose( ani )
  212.   x_Ani_DoFrame( ani, bmp, x, y, scr )                  -> d0=duration
  213.  
  214.   x_Spr_NewGrp( sprarray, sprcnt, flags, depth )        -> a0=sgrp/0
  215.   x_Spr_DisposeGrp( sgrp )
  216.   x_Spr_Draw( sgrp, destbmp, xoffset, yoffset )
  217.   x_Spr_Restore( sgrp, destbmp, bgnd, bgndwidth )
  218.   x_Spr_PrepGfx( sgfxarray, sgrp, count )               -> d0=success
  219.   x_Spr_UnPrepGfx( sgfxarray, count )
  220.   x_Spr_ChngGfx( sgfx, spr, nextframe )
  221.   x_Spr_CollChk( mode, spr1, spr2 )                     -> d0=collission
  222.   x_Spr_Sort( sgrp, customsort )
  223.   x_Spr_CutMsk( spr, data, x, y, width, height )
  224.   x_Spr_GrpCutMsk( sgrp, data, x, y, width, height )
  225.   x_Spr_AddBgBuf( spr, size )                           -> d0=success
  226.   x_Spr_GrpAddBgBuf( sgrp )                             -> d0=success
  227.   x_Spr_AddMskBuf( spr, size )                          -> d0=success
  228.   x_Spr_GrpAddMskBuf( sgrp )                            -> d0=success
  229.  
  230.   x_C2P_4( chunky, planar, cwidth, cheight, prowwidth, prowdiff )
  231.   x_C2P_4x( chunky, planar, cwidth, cheight, prowwidth, prowdiff )
  232.   x_C2P_4xy( chunky, planar, cwidth, cheight, prowwidth, prowdiff )
  233.   x_C2P_6( chunky, planar, cwidth, cheight, prowwidth, prowdiff )
  234.   x_C2P_6x( chunky, planar, cwidth, cheight, prowwidth, prowdiff )
  235.   x_C2P_6xy( chunky, planar, cwidth, cheight, prowwidth, prowdiff )
  236.   x_C2P_8( chunky, planar, cwidth, cheight, prowwidth, prowdiff )
  237.   x_C2P_8x( chunky, planar, cwidth, cheight, prowwidth, prowdiff )
  238.   x_C2P_8xy( chunky, planar, cwidth, cheight, prowwidth, prowdiff )
  239.  
  240.   x_MakeMask( source, dest, width, height, depth, mplane )
  241.   x_ClrBlit( dst, dstw, width, height )
  242.   x_MoveBlit( src, srcw, dst, dstw, width, height )
  243.  
  244. Miscellaneous functions:
  245. ~~~~~~~~~~~~~~~~~~~~~~~~
  246.   x_Randomize
  247.   x_Rnd                                                 -> d0=random
  248.  
  249.   x_LoadFile( filename, memflags )                      -> a0=loadedfile, d0.l=size
  250.   x_UnLoadFile( loadedfile )
  251.  
  252.   x_SetTaskPri( task, pri )                             -> d0=oldpri
  253.   x_RevertTaskPri
  254.   x_EasyRequest( window, titletxt, bodytxt, gadgettxt ) -> d0=num
  255.  
  256. General system functions callable without a library base:
  257. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  258.   x_DisplayBeep( scr )
  259.   x_Delay( ticks )
  260.   x_OwnBlitter
  261.   x_DisownBlitter
  262.   x_WaitBlit
  263.   x_WaitTOF
  264.   x_VBeamPos                                            -> d0.l=beampos
  265.   x_WBenchToFront                                       -> d0=success
  266.   x_WBenchToBack                                        -> d0=success
  267.   x_OpenWorkbench                                       -> d0=success
  268.   x_CloseWorkbench                                      -> d0=success
  269.  
  270. >-------------------------------------------------------------------------<
  271.  
  272.